package com.yt.fras.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yt.fras.mapper.UserRoleMapper;
import com.yt.fras.pojo.entity.Role;
import com.yt.fras.pojo.entity.UserRole;
import com.yt.fras.service.UserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户角色关联表 服务实现类
 * </p>
 *
 * @author yt
 * @since 2021-10-25
 */
@Service
@CacheConfig(cacheNames = "userRoleCache")
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements UserRoleService {

    @Autowired
    private UserRoleMapper userRoleMapper;

    @Override
    public Role getRoleByUser(String userId) {
        return userRoleMapper.getRoleByUser(userId);
    }

}
